@import './base.less';
@import './ui.less';

.container {
  height: 100%;
  width: 100%;
  position: relative;
  display: flex;
  justify-content: space-between;
}

/* 导航栏 */
.container nav {
  flex: 0 0 200px;
  height: auto;
  width: 200px;
  position: relative;

  ul {
    padding: 4px 2px 2px 0;
    overflow: auto;
    &::-webkit-scrollbar {
      width: 3px;
    }
    &::-webkit-scrollbar-thumb {
      border-radius: 10px;
      background: #bcd;
    }
    &::-webkit-scrollbar-track {
      border-radius: 0;
      background: #eef0f5;
    }
  }

  li {
    cursor: default;
    font-size: 13px;
    height: 40px;
    line-height: 40px;
    padding-left: 32px;
    position: relative;
    background: url('~/asset/record.svg') no-repeat 10px;
    background-size: 15px;
    color: #666666;
    border-left: 3px solid #eef0f5;
    opacity: 0.6;

    &.home {
      background: url('~/asset/home.svg') no-repeat 10px;
      background-size: 15px;
    }
    &.net {
      background: url('~/asset/recordFind.svg') no-repeat 10px;
      background-size: 15px;
    }
    &.mouse {
      background-color: #bedff7;
      border-left: 3px solid #51b0f5;
    }

    &.active,
    &:hover {
      background-color: #bedff7;
      border-left: 3px solid #51b0f5;
      opacity: 1;
      border-radius: 2px;
    }

    &:hover .option {
      cursor: pointer;
      position: absolute;
      width: 18px;
      height: 40px;
      right: 43px;
      top: 0px;
      background: url('~/asset/edit.svg') no-repeat center;
      background-size: 15px;
      opacity: 0.5;
      &:hover {
        opacity: 0.9;
      }
    }

    .onoff {
      position: absolute;
      right: 10px;
      top: 4px;
    }
  }

  &::after {
    content: 'LnnCoCo';
    position: absolute;
    bottom: 2px;
    left: 2px;
    color: rgba(204, 204, 204, 0.6);
    font-size: 12px;
    transform: scale(0.9);
    cursor: default;
  }
}

/* 内容框 */
.container main {
  flex: 1;

  .textarea {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    height: 98%;
    margin-top: 3px;
    margin-right: 3px;
    box-shadow: 0 0px 1px rgba(0, 0, 0, 0.1);

    textarea {
      height: 100%;
      width: 100%;
      border: none;
      outline: none;
      font-size: 15px;
    }

    // 背景
    .background-image-layer() {
      content: '';
      position: absolute;
      width: 50%;
      height: 62%;
      right: 5px;
      bottom: 5px;
      opacity: 0.06;
    }
    &.local .CodeMirror::before {
      .background-image-layer();
      background: url('~/asset/record.svg') no-repeat right bottom;
      background-size: contain;
    }
    &.net .CodeMirror::before {
      .background-image-layer();
      background: url('~/asset/recordFind.svg') no-repeat right bottom;
      background-size: contain;
    }
    &.lock .CodeMirror::before {
      .background-image-layer();
      background: url('~/asset/lock.svg') no-repeat right bottom;
      background-size: contain;
    }
    &.home .CodeMirror::before {
      .background-image-layer();
      background: url('~/asset/home.svg') no-repeat right bottom;
      background-size: contain;
    }

    // 操作按钮
    &.home .operation {
      display: block;
      .refresh {
        display: inline-block;
      }
    }
    &.net .operation {
      display: block;
      .net {
        display: inline-block;
      }
    }
    &.save .operation {
      display: block;
      .save {
        display: inline-block;
      }
    }

    .operation {
      display: none;
      position: absolute;
      z-index: 110;
      top: 17px;
      right: 22px;
      background-color: rgba(189, 189, 189, 0.226);
      height: 20px;
      padding: 2px 13px;
      border-radius: 16px;
      transition: all 0.2s;

      .operation-icon() {
        display: none;
        width: 17px;
        height: 20px;
        opacity: 0.2;
        margin: 0 3px;
        &:hover {
          cursor: pointer;
          opacity: 0.6;
        }
      }

      .refresh {
        .operation-icon();
        background: url('~/asset/refresh.svg') no-repeat center;
        background-size: contain;
      }

      .net {
        .operation-icon();
        background: url('~/asset/download.svg') no-repeat center;
        background-size: contain;
      }

      .save {
        .operation-icon();
        background: url('~/asset/save.svg') no-repeat center;
        background-size: contain;
      }
    }
  }
}

/* 弹窗样式 */
.dialog-item {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 360px;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  display: none;
  z-index: 100;

  &.active {
    display: block;
  }
  .item-hader {
    height: 40px;
    line-height: 40px;
    padding-left: 15px;
    border-bottom: 1px solid #e8e8e8;
    font-size: 15px;
  }
  .item-operation {
    overflow: hidden;
    padding: 10px;
    border-top: 1px solid #e8e8e8;

    .ui-button {
      float: right;
      & + .ui-button {
        margin-right: 10px;
      }
    }
  }
  .item-body {
    padding: 20px 40px;
    font-size: 14px;
    .form-item + .form-item {
      margin-top: 15px;
    }
    input {
      width: 200px;
      font-size: 13px;
    }
  }
}

.shade {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: 99;
}

/* 右键菜单 */
.context-menu {
  position: absolute;
  width: 111px;
  padding: 5px 0;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  border: 1px solid #d0d0d5;
  border-radius: 2px;
  font-size: 14px;
  animation: fadeIn 0.2s;
  z-index: 200;
  left: -99999px;
  top: -99999px;
  .menu-item {
    display: block;
    line-height: 20px;
    padding: 8px 10px 7px;
    color: #4c5161;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    &:hover {
      background-color: #f0f7ff;
    }
    &.disabled {
      cursor: default;
      pointer-events: none;
      opacity: 0.4;
      &:hover {
        background-color: transparent;
      }
    }
    .icon {
      display: inline-block;
      width: 13px;
      height: 13px;
      transform: translateY(2px);
      img {
        width: 100%;
        height: 100%;
      }
    }
  }
  .menu-line {
    border: 0;
    border-bottom: 1px solid #d0d0d5;
    margin: 7px 11px;
    opacity: 0.4;
  }
  .menu-target {
    cursor: default;
    padding-top: 2px;
    padding-bottom: 6px;
    font-size: 12px;
    color: #b9b9b9b0;
    height: 12px;
    line-height: 12px;
    transform: scale(0.8);
  }
}
